// import { debounce } from 'loadsh';
interface UseThrottleProps {
  callback: (e: any) => void,
  time?: number
}

export const useDebounce = ({ callback, time = 500 }: UseThrottleProps) => {
  var timer: any = null;
  return (e:any) => {
    clearTimeout(timer)
    timer = setTimeout(() => {
      callback(e)
    }, time)
  }
}

// export const useDebounce = ({ callback, time = 500 }: UseThrottleProps) => {
//   debounce(callback, time)
// }


